package com.siemens.exercise;

public class Execute {
	private Command addExecute;
	private Command subtractExecute;
	private Command multiplyExecute;
		
	public Execute(){}	
	public Execute(Command addExecute, Command subtractExecute, Command multiplyExecute) {
		this.addExecute = addExecute;
		this.subtractExecute = subtractExecute;
		this.multiplyExecute = multiplyExecute;
	}
	
	public int add (String s) throws NegtiveNumException {
		return addExecute.calc(s);
	}	
	public int subtract (String s) throws NegtiveNumException {
		return subtractExecute.calc(s);
	}	
	public int multiply (String s) throws NegtiveNumException {
		return multiplyExecute.calc(s);
	}
}

